## --------------------------------------------------------------------
## ykit FARedis
## --------------------------------------------------------------------


    set(SOURCES_files_SourceFiles
      #dllmain.cpp
      FARedis.cpp
	  FARedis.def
      FARedis.h
	  ../inc/FARedis/xredisPCH.h
	  ../inc/ctpImpl/marketDataArchive.h
    )
    source_group("Source Files" FILES ${SOURCES_files_SourceFiles})

	set(SOURCES_files_hiredis
      ../inc/hiredis/dict.c	     
	  ../inc/hiredis/hiredis.c	  	
	  ../inc/hiredis/net.c
	  ../inc/hiredis/sds.c
	  ../inc/hiredis/src/win32fixes.c
	  )
    source_group("Source Files\\hiredis" FILES ${SOURCES_files_hiredis})
	
	set(SOURCES_files_xredis
      ../inc/xredis/xRedisClient.cpp	     
	  ../inc/xredis/xRedisClient_connection.cpp
	  ../inc/xredis/xRedisClient_hashs.cpp
	  ../inc/xredis/xRedisClient_keys.cpp
	  ../inc/xredis/xRedisClient_lists.cpp
	  ../inc/xredis/xRedisClient_sets.cpp
	  ../inc/xredis/xRedisClient_sortedsets.cpp
	  ../inc/xredis/xRedisClient_strings.cpp
	  ../inc/xredis/xRedisPool.cpp
	  )
    source_group("Source Files\\xredis" FILES ${SOURCES_files_xredis})



    set(SOURCES_SourceFiles
      ${SOURCES_files_SourceFiles}
      ${SOURCES_files_hiredis}
      ${SOURCES_files_xredis}
    )
	
	set(SOURCES_
		${SOURCES_SourceFiles}
	)
  
INCLUDE_DIRECTORIES(../inc/)
LINK_DIRECTORIES(${CMAKE_SOURCE_DIR}/lib)

  if(WIN32)	
   SET(CMAKE_CXX_FLAGS_DEBUG "/MTd /Z7 /Od")
   SET(CMAKE_CXX_FLAGS_RELEASE "/MT /O2")
   SET(CMAKE_CXX_FLAGS_MINSIZEREL "/MT /O2")
   SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MTd /Z7 /Od")
endif(WIN32)

SET(ProjectName FARedis)
SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR})

ADD_LIBRARY(${ProjectName} SHARED ${SOURCES_})
Add_Definitions(-DFAREDIS_EXPORTS)
Add_Definitions(-DUNICODE -D_UNICODE)

ADD_DEPENDENCIES(${ProjectName} FABase FAJson FACore)
TARGET_LINK_LIBRARIES(${ProjectName} ws2_32 FABase FAJson FACore)

if(NOT WIN32)
add_definitions(-D_PORT_VERSION -Wno-deprecated  -fPIC)
if(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE STREQUAL "Release" OR "MinSizeRel" OR "RelWithDebInfo")
add_definitions(-DNDEBUG)
endif(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE STREQUAL "Release" OR "MinSizeRel" OR "RelWithDebInfo")
endif(NOT WIN32)
